Ext.regController("Login",{
    index: function(){
        
        var index = Gallery.CommonStore.findExact("key","uk");
        console.log("index uk : "+index);
        if(index >= 0)
        {
            Gallery.logged = true;
            
            Gallery._useruuid = Gallery.CommonStore.getAt(index).data.value;
            Gallery._userlogin = Gallery.CommonStore.getAt(Gallery.CommonStore.findExact("key","lg")).data.value;
            
            Gallery.viewport.addDocked([topToolbar]);
            
            Ext.redirect("Album/index");
        }
        else
        {
				  console.log("redirect");
            Ext.redirect("Login/viewForm");
        }
    },
    viewForm: function(){
				  console.log('viewFrom Login');
        var loginView = this.render({
            xtype: 'login'
        });
        Gallery.viewport.setActiveItem(loginView);
    }
});